import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-06-30
 * Time: 22:03
 */
public class Test8 {
    public static int lengthLongestSubstring(String s) {
        int ret = 0;
        char[] ch = s.toCharArray();
        int[] hash = new int[128];
        for(int left = 0, right = 0; right < s.length();right++) {
            hash[ch[right]]++;
            while(hash[ch[right]] > 1) {
                hash[ch[left]]--;
                left++;
            }
            ret = Math.max(right-left+1,ret);
        }
        return ret;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int ret = lengthLongestSubstring(s);
        System.out.println("最长子串个数:"+ret);
    }

}
